<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml" id="teacherForm">
<head>
    <title>课程浏览</title>
    <style>
        .l-table-edit-td { padding: 2px; }
    </style>
    <script type="text/javascript" src="${ctx}/static/flowplayer/flowplayer-3.2.12.min.js"></script> 
    <script type="text/javascript">
    var mainform;
    var viewType = "${viewType}";

    $(function (){
        mainform=$("#mainform");
        
        mainform.ligerForm();
        
        //LG.setFormDefaultBtn(cancel, null);
        
        $("a[name='material']").bind('click', function(event){
        	var FileName = $(this).attr('path');
        	var pid = $(this).attr('id');
        	var FileExt = FileName.substring(FileName.lastIndexOf('.')+1, FileName.length).toLowerCase();
        	var parent = window.parent;
        	if(FileExt == "flv") {//播放flv文件
        		/*
	        	var dialog=parent.$.ligerDialog.open({url: '${ctx}/qso/clistView/play?pType=flv&id='+pid,height:560, 
	        		isHidden: false, width:700, showMax: true, showToggle: true, showMin: true, 
					isResize: true, modal: true, title:"播放", onBeforeClose:
						function() {
	    				dialog.close(); 
	    				},
	  					buttons:[{text:"取消",onclick:function(item,d){
							dialog.close();}}]
	    				});
        		*/
        		window.open("${ctx}/qso/clistView/play?pType=flv&id="+pid,
    					"playView","height=510,width=670,left=300,top=100,scrollbars=yes,resizable=yes");
        	}
        	else
        	{
        		/*
        		var dialog=parent.$.ligerDialog.open({url: '${ctx}/qso/clistView/play?pType=swf&id='+FileName,height:640, 
					isHidden: false, width:950, showMax: true, showToggle: true, showMin: true, 
					isResize: true, modal: true, title:"播放", onBeforeClose:
					function() {
        				dialog.close();
        				parent.window.location.reload(true);
        				},
      					buttons:[{text:"取消",onclick:function(item,d){
							dialog.close();}}]
        				});
        		*/
        		window.open('${ctx}/qso/clistView/play?pType=swf&id='+encodeURI(FileName),
    					"playView","height=600,width=950,left=200,top=50,scrollbars=yes,resizable=yes");

        	}
            
        }); 
    });
    
    function cancel(){
       /* var win = window.parent || window;
        if(win.dialog){
            try {
                $f("player").stop();
            } catch (error) {}

        	win.dialog.close();
        }*/
      //var parent = window.parent;
      //$("#Dialog1001").closeDialog();
    }
 </script>
</head>

<body>
	<table class="l-table-edit" style="width: 90%; margin-top:10px; margin-left:15px; padding:15px;">
	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">课程名称:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;">${btable.couid.title}</td>
	        <td align="right" class="l-table-edit-td" style="width:15%;">科系:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;">${btable.dptid.title}</td>
	    </tr>
	     <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">教师姓名:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;">${btable.teaid.terName}</td>
	        <td align="right" class="l-table-edit-td" style="width:15%;">班级:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;">${btable.claid.clsTitle}</td>
	    </tr>
	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">教室名称:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;">${btable.crmid.crmTitle}</td>
	        <td align="right" class="l-table-edit-td" style="width:15%;">年级:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;">${btable.gradeid.gradeTitle}</td>
	    </tr>
	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">教学目的:</td>
	        <td align="left" class="l-table-edit-td" style="width:80%;" colspan="3">${empty creContent ? "" : creContent.aim}</td> 
	    </tr>
	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">教学重点:</td>
	        <td align="left" class="l-table-edit-td" style="width:80%;" colspan="3">${empty creContent ? "" : creContent.keynote}</td> 
	    </tr>
	    
   	    <c:if test="${not empty materialDs}">
	    	<c:forEach items="${materialDs}" var="materialD" varStatus="status">
 	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;"><c:if test="${1 eq status.count}">教材列表:</c:if></td>
	        <td align="left" class="l-table-edit-td" style="width:80%;" colspan="3"><a path="${materialD.path}" id="${materialD.id}" name="material"><u>${materialD.title}</u></a></td> 
 	    </tr>
	  	 	 </c:forEach>
	    </c:if>
	     
<!-- 		<tr>  -->
<!-- 			<td colspan="4"> -->
<!-- 				<div style="width: 640px;height:480px;background-color:#444;color:#fff;" id="player" class="player"></div> -->
<!-- 			</td> -->
<!-- 		</tr>  -->
		
		<tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">课件说明:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;"  colspan="3">${empty aid ? "" : aid.intro}</td> 
	    </tr>
		
		<c:if test="${not empty aidAttachments}">
	    	<c:forEach items="${aidAttachments}" var="aidAttachment" varStatus="status">
    	<tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;"><c:if test="${1 eq status.count}">课程附件:</c:if></td>
	        <td align="left" class="l-table-edit-td" style="width:35%;"  colspan="3"><a href="${ctx}/qso/attachment/downLoad/${aidAttachment.id}">${aidAttachment.originalName}</a></td> 
	    </tr>
	    	</c:forEach>
	    </c:if>
	     
	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;">作业描述:</td>
	        <td align="left" class="l-table-edit-td" style="width:35%;"  colspan="3">${empty homeworkH ? "" : homeworkH.title}</td> 
	    </tr>
	    
	    <c:if test="${not empty homeworkHAttachments}">
	    	<c:forEach items="${homeworkHAttachments}" var="homeworkHAttachment" varStatus="status">
	    <tr>
	        <td align="right" class="l-table-edit-td" style="width:15%;"><c:if test="${1 eq status.count}">作业附件:</c:if></td>
	        <td align="left" class="l-table-edit-td" style="width:35%;"  colspan="3"><a href="${ctx}/qso/attachment/downLoad/${homeworkHAttachment.id}">${homeworkHAttachment.originalName}</a></td> 
	    </tr>
	  	  </c:forEach>
	    </c:if>
	</table>
</body>
</html>